package com.xuanyuanxinyu.utils.net;

import android.content.Context;

import java.net.NetworkInterface;
import java.net.SocketException;

/**
 * @author tanzh
 */
public class VpnUtils {

    public static NetworkInterface vpnNetwork;

    private static final String TAG = "VpnUtils";

    public static boolean checkVpnExist(Context context) {
        try {
            NetworkInterface networkInterface = NetworkInterface.getByName("tun0");
            if (null != networkInterface) {
                vpnNetwork = networkInterface;
                return true;
            }
        } catch (SocketException e) {
            e.printStackTrace();
        }
        return false;
    }
}
